Delphi Developer's Guide to XML
Appendix B - Mass Electronic Mail-Outs

Previous   Next   Listings

Perform mass mail-outs using information from a database. XML provides the configuration parameters and the message template. Other standards allow database access (SQL) and e-mail functionality (SMTP), while a modular approach reduces ongoing maintenance. The Microsoft DOM provides the XML parsing abilities.

MailTemplate.dpr   A console application that performs mass e-mailings based on XML configuration and message content
MailTemplateConst.pas   Constants used throughout the application
XMLConfig.pas   A generic unit for reading in an XML-based configuration file based on Microsoft's DOM
MailTemplateLog.pas   Logging support for the application
MailTemplateMessage.pas   Loading and processing of the e-mail message with substitutions from the database
MailTemplateQuery.pas   Access to the mailing database
MailTemplateSender.pas   Interface to a SMTP component
MailTemplate.xml   The configuration file XML document
MailMessage.xml   The mail message and database query XML document
MailMessage.dtd   Its DTD
Customer.db   The database table of e-mail recipients

This project requires the MSXML v3 or v4 package from Microsoft.

This example requires a "mailtemp" BDE alias for the customer table.

Zipped Files

Delphi Developer's Guide to XML © 2003, Keith Wood Previous   Next   Listings